package com.wyp168.servicecms.controller;

import com.wyp168.commonutils.R;
import com.wyp168.servicecms.entity.CrmBanner;
import com.wyp168.servicecms.service.CrmBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/servicecms/bannerfront")
public class BannerFrontController {

    @Autowired
    private CrmBannerService bannerService;

    //查询所有Banner
    @GetMapping("getAllBanner")
    public R getAllBanner() {
        List<CrmBanner> crmBannerList = bannerService.selectAllBanner();

        return R.ok().data("crmBannerList",crmBannerList);
    }

}
